package com.blog.entity;

/**
 * 分类实体类 - 对应数据库category表
 */
public class Category {
    private int id;             // 分类ID
    private String name;        // 分类名称
    private String description; // 分类描述
    private int userId;         // 所属用户ID

    // 无参构造函数
    public Category() {}

    // 带参构造函数
    public Category(String name, String description, int userId) {
        this.name = name;
        this.description = description;
        this.userId = userId;
    }

    // Getter和Setter方法
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public int getUserId() {
        return userId;
    }

    public void setUserId(int userId) {
        this.userId = userId;
    }

    @Override
    public String toString() {
        return "Category{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", userId=" + userId +
                '}';
    }
}